'use strict';
var f_gas = require('./gas');//气体相关换算
var f_RON = require('./RON');//插值法辛烷值计算
var f_16 = require('./16')//四变量法十六烷值
var f_density = require('./density')//密度计算

exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let {
		f_name,
		f_value
	} = event
	var resulted = '未定义'
	console.log(f_name)
	switch (f_name) {
		case 'density':	
			resulted = f_density.density(f_value)
			break;
		case '16':
			resulted = f_16.calc_16(f_value)
			break;
		case 'RON-Interpolation':
			resulted = f_RON.calc(f_value);
			break;
		case 'GasConversionAndCalculation':
			resulted = f_gas.converts(f_value);
			break;
		case 'excel':
			break;
		default:
			break;
	}

	//返回数据给客户端
	return resulted
};
